#include <functional>
#include "ThreadPool.hpp"

using namespace threadPoolModule;

using task_t = std::function<void()>;
// using task_t = void(*)();

void Download()
{
    LOG(LogLevel::DEBUG) << "这是一个下载任务";
}

void test()
{
    // ThreadPool<task_t> threads; 
    // threads.start();
    // threads.pushTask(Download);
    // threads.stop();
    // threads.join();

    ThreadPool<task_t>::getInstance()->start();

    ThreadPool<task_t>::getInstance()->pushTask(Download);

    ThreadPool<task_t>::getInstance()->stop();

    ThreadPool<task_t>::getInstance()->join();

}

int main()
{
    test();

    return 0;
}
